done = "wx去完成.jpg"
list = "wx做任务集爆竹.jpg"

regiony0=1030
regiony=1818

while true do
    x,y = image.findImageInRegion(list,796,1394,1069,1720,500000)--做任务集爆竹
    if x~=-1 and x~=-1 then
        event.tap(x,y)
        toast("做任务集爆竹") 
        mSleep(3000)
    end
   
    wid= widget.find({["ID"]="_n_87"})
    if  wid  then
        x,y = image.findImageInRegion(done,744,regiony0,984,regiony,500000)--去完成任务
        if x~=-1 and x~=-1 then
            event.tap(x,y)
            toast("去完成然后等待 12 秒") 
            mSleep(12*1000)
                keycode.back()
                toast("返回") 
                mSleep(5000) 
        end
    end
end